getPartial1(const Int_t ipar)
{
  hh=(TH2D*)gDirectory->Get(Form("mcpar%d",ipar));
  hb=(TH2D*)gDirectory->Get("mcpar3");
  hmeanx=(TH1D*)gDirectory->Get("meanx");

  ff=new TFile(Form("type%d3.root",ipar),"recreate");
  ha=(TH2D*)hh->Clone("mcpar0");
  hb->SetName("mcpar1");
  hh->SetName("horiginal");
  hh->Add(hb);
  hy=hh->ProjectionX("horiginalyield",1, hh->GetNbinsY(),"oe");
  ha->Write();
  hb->Write();
  hh->Write();
  hy->Write();
  hmeanx->Write();
  ff->Save();
  ff->Close();
}

getPartial2(const Int_t ipar1, const Int_t ipar2)
{
  hh=(TH2D*)gDirectory->Get(Form("mcpar%d",ipar1));
  hb=(TH2D*)gDirectory->Get(Form("mcpar%d",ipar2));
  hc=(TH2D*)gDirectory->Get("mcpar3");
  hmeanx=(TH1D*)gDirectory->Get("meanx");

  ff=new TFile(Form("type%d%d3.root",ipar1,ipar2),"recreate");
  ha=(TH2D*)hh->Clone("mcpar0");
  hb->SetName("mcpar1");
  hc->SetName("mcpar2");
  hh->SetName("horiginal");
  hh->Add(hb);
  hh->Add(hc);
  hy=hh->ProjectionX("horiginalyield",1, hh->GetNbinsY(),"oe");
  ha->Write();
  hb->Write();
  hc->Write();
  hh->Write();
  hy->Write();
  hmeanx->Write();
  ff->Save();
  ff->Close();
}
